home *** CD-ROM | disk | FTP | other *** search
- #include "shared.h"
- #include <String.h>
- #include <Resources.h>
- #include <Fonts.h>
- #include <TextUtils.h>
-
- /***************************************************
- GetUserName
- ****************************************************/
- void GetUserName( Str63 userName ) {
-
- StringHandle sh;
-
- /* this is where the appletalk name is kept in the system */
- sh = GetString(kAppleTalkUserNameID);
-
- BlockMoveData( *sh, userName, *sh[0]+1 );
-
- ReleaseResource( (Handle)sh);
- }
-
- /***************************************************
- DisplayErrorAlert
- ****************************************************/
- Boolean DisplayErrorAlert( ComponentResult result ) {
-
- DialogPtr alertPtr;
- Handle hString = nil;
- short itemHit;
- Str255 errorCode = "\p";
-
- if (( result != noErr) && (result != kTimeToQuit)) {
- alertPtr = GetNewDialog(kErrorAlertID, nil, (WindowRef) -1);
- SetDialogDefaultItem(alertPtr, kOKItem);
-
- if ((result < 32767) && (result > -32766))
- hString = GetResource( kErrorStringType, result );
- else
- hString = nil;
-
- if (hString == nil)
- {
- hString = (Handle)GetString( kGenericError );
- NumToString(result, errorCode);
- }
-
- HLock(hString);
- ParamText( (ConstStr255Param)*hString, errorCode, 0, 0 );
-
- ModalDialog(nil, &itemHit);
-
- HUnlock( hString );
- ReleaseResource( hString );
- DisposeDialog( alertPtr );
- }
-
- if (result == kTimeToQuit)
- return true;
- else
- return false;
- }
-
- /***************************************************
- DoAboutBox
- ****************************************************/
- void DoAboutBox( void ) {
- DialogPtr aboutBox;
- short itemHit;
-
- aboutBox = GetNewDialog(kAboutBoxID, nil, (WindowRef) -1);
-
- SetDialogDefaultItem(aboutBox, kOKItem);
-
- SetPort((WindowPtr)aboutBox);
-
- TextFont(applFont);
-
- TextSize( 9 );
-
- ModalDialog(nil, &itemHit);
-
- DisposeDialog(aboutBox);
- }
-
- /***************************************************
- OpenSplashScreen
- ****************************************************/
- DialogPtr OpenSplashScreen( void ) {
-
- DialogPtr splash;
-
- splash = GetNewDialog(kSplashDialogID,nil,(WindowPtr)-1);
-
- if (splash)
- DrawDialog(splash);
-
- return splash;
- }
-
- /***************************************************
- PToCString
- ****************************************************/
- void PToCString( Str63 name, MTCString63 cName)
- {
- int i;
-
- for ( i = 0; i < name[0]; i++)
- cName[i] = name[i+1];
-
- cName[i] = 0;
- }
-
-
-